//
//  AnimeModel.m
//  GentlemanAnime
//
//  Created by dlios on 15-6-29.
//  Copyright (c) 2015年 lanou3g.com 蓝欧科技. All rights reserved.
//

#import "AnimeModel.h"

@implementation AnimeModel
- (void)dealloc {
    [_headlinesModel release];
    [_episodeArr release];
    [super dealloc];
}



- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"headlines"]) {
        self.headlinesModel = [[HeadlinesModel alloc] init];
        [self.headlinesModel setValuesForKeysWithDictionary:(NSDictionary*)value];
    } else if ([key isEqualToString:@"episode"]) {

        self.episodeArr = [NSMutableArray array];
        NSArray *arr = (NSArray *)value;
        for (NSDictionary *tempDic in arr) {
            EpisodeModel *episodeModel = [[EpisodeModel alloc] init];
            [episodeModel setValuesForKeysWithDictionary:tempDic];
            [self.episodeArr addObject:episodeModel];
            [episodeModel release];
        }
    }
}
@end

